package com.jymj.controller;

import com.jymj.entity.SysUserEntity;
import com.jymj.service.SysUserRoleService;
import com.jymj.service.SysUserService;
import com.jymj.utils.ShiroUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Controller公共组件
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2016年11月9日 下午9:42:26
 */
public abstract class AbstractController {

    protected Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    SysUserRoleService sysUserRoleService;
    @Autowired
    SysUserService sysUserService;

    protected SysUserEntity getUser() {
        SysUserEntity user = ShiroUtils.getUserEntity();
        //user = sysUserService.queryObjectType(user.getUserId());
        return user;
    }

    protected Long getUserId() {
        return getUser().getUserId();
    }
}
